package demo1;

import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-08-08
 * Time: 10:30
 */
public class demo4 {

    public static void main(String[] args) throws IOException {
        File file = new File("D:/t1.txt");
        file.createNewFile();
        System.out.println(file.getName());
        File file2 = new File("D:/t2.txt");
        file.renameTo(file2);
        System.out.println(file2.getName());
    }

}
